#!/bin/sh

set -e

CheckArchitecture()
{
        if [ "`uname -m`" = "x86_64" ]; then
            printf "\n Running 32-bit AIR on 64-bit systems has not been fully tested. However, 32-bit AIR is expected to run on 64-bit systems if they have the required 32-bit libraries and packages installed. \n The following links describe how to install or update AIR 2.5 on 64-bit versions of Ubuntu 9.10, Fedora Core 12 and OpenSuse 11.2. \n Installing Adobe AIR 2.5 on 64-bit Linux visit http://kb2.adobe.com/cps/521/cpsid_52132.html \n Updating to Adobe AIR 2.5 on 64-bit Linux visit http://kb2.adobe.com/cps/521/cpsid_52132.html\n"
        fi
        return 0
}

CheckKeyring()
{
	for i in /usr/lib/libgnome-keyring* /lib/libgnome-keyring* /usr/lib/libkwallet* /lib/libkwallet*; do
		if [ -f "$i" ]; then
			return 0
		fi
	done

	echo "Adobe AIR could not be installed. Either gnome-keyring or Kwallet must be installed prior to installing Adobe AIR." >&2
	return 0
}

CheckDependencies()
{
	CheckArchitecture && true
}


CheckDependencies || exit 1

exit 0

